#include "TilePlotter.h"
int TilePlotter::tileWidth(96), TilePlotter::tileHeight(48);
int TilePlotter::mapWidth(32), TilePlotter::mapHeight(32);


sf::Vector2f TilePlotter::PlotTile(int row, int col)
{
	sf::Vector2f pos;
	pos.x = mapWidth/2 - tileWidth/2 - row*tileWidth/2 + col*tileWidth/2;
	pos.y = row*tileHeight/2 + col*tileHeight/2;
	
	return pos;
}
sf::Vector2i TilePlotter::PlotTileInt(int row, int col)
{
	sf::Vector2i pos;
	pos.x = mapWidth/2 - tileWidth/2 - row*tileWidth/2 + col*tileWidth/2;
	pos.y = row*tileHeight/2 + col*tileHeight/2;

	return pos;
}
// Pos.x = ROW; Pos.y = COL;
sf::Vector2i TilePlotter::PlotTileInt(const sf::Vector2i& Pos)
{
	int row = Pos.x;
	int col = Pos.y;
	sf::Vector2i pos;
	pos.x = mapWidth/2 - tileWidth/2 - row*tileWidth/2 + col*tileWidth/2;
	pos.y = row*tileHeight/2 + col*tileHeight/2;

	return pos;
}
// Pos.x = ROW; Pos.y = COL;
sf::Vector2f TilePlotter::PlotTile(const sf::Vector2i& Pos)
{
	int row = Pos.x;
	int col = Pos.y;
	sf::Vector2f pos;
	pos.x = mapWidth/2 - tileWidth/2 - row*tileWidth/2 + col*tileWidth/2;
	pos.y = row*tileHeight/2 + col*tileHeight/2;

	return pos;
}
